<?php

namespace common\models\trend;

use Yii;

/**
 * This is the model class for table "{{%trend_rule}}".
 *
 * @property int $id
 * @property string $name 规则名称
 * @property string $handle 规则处理标识
 * @property int $exp 经验
 * @property int $credit 积分
 * @property int $gold 金币
 * @property int $limit 周期内受限次数，0为不限
 * @property int $repeat 周期性，0为一次有效
 * @property string $message 日志备注信息
 * @property int $status 状态
 * @property int $created_at 获得时间
 * @property int $updated_at 更新时间
 * @property int $deleted_at 删除时间
 */
class TrendRule extends \common\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%trend_rule}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['name', 'handle'], 'required'],
            [['exp', 'credit', 'gold', 'limit', 'repeat', 'status', 'created_at', 'updated_at', 'deleted_at'], 'integer'],
            [['name', 'handle'], 'string', 'max' => 50],
            [['message'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '规则名称',
            'handle' => '规则处理标识',
            'exp' => '经验',
            'credit' => '积分',
            'gold' => '金币',
            'limit' => '周期内受限次数，0为不限',
            'repeat' => '周期性，0为一次有效',
            'message' => '日志备注信息',
            'status' => '状态',
            'created_at' => '获得时间',
            'updated_at' => '更新时间',
            'deleted_at' => '删除时间',
        ];
    }
}
